package com.yjd.pub.order.service;

import java.util.HashMap;
import java.util.Map;

import javax.annotation.Resource;
import org.springframework.stereotype.Service;

import com.yjd.comm.base.dao.IBaseDao;
import com.yjd.comm.base.service.impl.BaseServiceImpl;
import com.yjd.comm.order.model.OrderStatusModel;
import com.yjd.comm.order.service.IOrderStatusService;
import com.yjd.pub.order.dao.IOrderStatusDao;

/**
 * <b>description</b>：订单状态变更记录业务实现<br>
 * <b>time</b>：2017-08-11 17:31:18 <br>
 * <b>author</b>：  yangchangyan@yijiedai.com
 */
@Service("orderStatusService")
public class OrderStatusServiceImpl extends BaseServiceImpl implements IOrderStatusService {

	/**
	 * 插入
	 * 
	 * @param model
	 * @return
	 * @throws Exception
	 */
	public OrderStatusModel insert(OrderStatusModel model) throws Exception {
		return this.orderStatusDao.insertModel(model, true);
	}

	/**
	 * 更新
	 * 
	 * @param model
	 * @return
	 * @throws Exception
	 */
	public int update(OrderStatusModel model) throws Exception {
		return this.orderStatusDao.updateModel(model, true);
	}

	/**
	 * 根据id删除
	 * 
	 * @param id
	 * @return
	 * @throws Exception
	 */
	public int delete(long id) throws Exception {
		Map<Object, Object> paramMap = new HashMap<Object, Object>();
		paramMap.put("id", id);
		return this.orderStatusDao.deleteModel(paramMap, true);
	}

	@Resource
	private IOrderStatusDao orderStatusDao;

	@Override
	public IBaseDao getBaseDao() {
		return this.orderStatusDao;
	}

}
